package com.apps.goods.model.vo;

import com.apps.goods.model.po.KupaGoodsCat;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 用作PC端前端导航数据
 */
@Data
public class KupaGoodsCatVo implements Serializable {

    private static final long serialVersionUID = 8186559748148888544L;

    private Integer cat_id;

    private String cat_name="";

    private List<KupaGoodsCatVo> child=new ArrayList<>();

    public KupaGoodsCatVo()
    {

    }
    public KupaGoodsCatVo(KupaGoodsCat goodsCat)
    {
        this.cat_id = goodsCat.getId();
        this.cat_name = goodsCat.getName();
    }
    public KupaGoodsCatVo(KupaGoodsCat goodsCat,List<KupaGoodsCat> childs)
    {
        this.cat_id = goodsCat.getId();
        this.cat_name = goodsCat.getName();
        for(KupaGoodsCat cat:childs)
            this.child.add(new KupaGoodsCatVo(cat));
    }
}
